package com.bingbing.back.service.Impl;

import com.bingbing.back.dto.AdminInfoDto;
import com.bingbing.back.mapper.AdminInfoMapper;
import com.bingbing.back.po.AdminInfo;
import com.bingbing.back.service.AdminInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminInfoServiceImpl implements AdminInfoService {
    @Resource
    private AdminInfoMapper adminInfoMapper;
    @Override
    public PageInfo<AdminInfo> findByParam(int pageNum, int pageSize, AdminInfoDto dto) {
        PageInfo<AdminInfo> page=null;
        PageHelper.startPage(pageNum,pageSize);
        List<AdminInfo> ads=adminInfoMapper.findByParam(dto);
        page=new PageInfo<>(ads);
        return page;
    }
    @Override
    public int doUpdate(AdminInfoDto dto) {
        int row=0;
        row=adminInfoMapper.update(dto);
        return row;
    }
    @Override
    public int doDelete(Integer adminId){
        int row=0;
        row=adminInfoMapper.delete(adminId);
        return row;

    }
    @Override
    public int doDeleteMul(int[] adminIds){
        int row=0;
        row=adminInfoMapper.deleteMul(adminIds);
        return row;
    }
}
